<h1>Routing: An Overview</h1>

<p>In web development, <b>routing</b> is the process of directing incoming web requests to the appropriate code that should handle those requests. Trongate's routing system manages this by mapping URLs (Uniform Resource Locators) to specific modules, controllers, and methods within your application.</p>

<p>Trongate uses a segment-based URL routing approach that creates clean, user-friendly URLs. This is in contrast to traditional PHP applications that often use query strings with symbols like question marks and ampersands.</p>

<h2>Routing Example</h2>
<p>Consider a product page on an e-commerce website. Using traditional PHP, you might see a URL like this:</p>

[code]https://example.com/store_items.php?id=35[/code]

<p>With Trongate's routing system, you can create more readable and professional URLs like this:</p>

[code]https://example.com/<mark>lenovo-thinkpad</mark>[/code]

<p>Clean URLs like this offer several benefits:</p>
<ul>
    <li>They're easier for users to read, understand, and remember</li>
    <li>They look more professional and trustworthy</li>
    <li>They're more friendly for search engine optimization (SEO)</li>
    <li>They hide implementation details of your application</li>
</ul>

<p>Trongate provides three main ways to handle routing:</p>
<ol>
    <li><strong>Homepage Routing:</strong> Special rules for handling requests to your website's homepage</li>
    <li><strong>Automatic Routing:</strong> URLs are automatically mapped to your code based on simple conventions</li>
    <li><strong>Custom Routing:</strong> Define your own URL patterns for specific needs</li>
</ol>

<p>The following pages will explore each of these routing methods in detail, showing you how to create clean, professional URLs for your web applications.</p>